define(function() {
	return function($compile, $scope) {
		require([ "AppPathDir/account/accountInfos/support",
				"AppPathDir/account/accountInfos/add",
				"AppPathDir/account/accountInfos/update",
				"AppPathDir/account/accountInfos/delete" ],
				function(Support, AddSupport, UpdateSupport, delSupport) {

					/* 查询 start */
					$scope.search = {};
					$scope.cache = {};
					$scope.searchSupport = {
						run : function() {
							$scope.gridFun();
//							$scope.grid.reload({
//								queryParam : $scope.search
//							})
						}
					};
					//支付类型
					$.ajax({
						url : getServer() + "/flea/hclv/getPayTypeTwo.htmls",
						success : function(data) {
                            if (data.status != 200) {
                                return;
                            }
							$scope.cache.types = data.data;
							$scope.gridFun();
							
						}
					});
					$scope.gridFun = function(){
						//表格数据
						$.ajax({
							url : getServer() + "/flea/hclv/qr/manage/selectByDeptId.htmls",
							success : function(data) {
                                if (data.status != 200) {
                                    return;
                                }
								$scope.grid.reload({
									data : data.data
								})
							}
						});
					}
					/* 查询 end */
					$scope.addSupport = AddSupport($scope, $compile);
					$scope.updateSupport = UpdateSupport($scope, $compile);
					$scope.delSupport = delSupport($scope, $compile);
					$scope.grid = Support.init($scope.cache, $scope.addSupport,
							$scope.updateSupport, $scope.delSupport,
							$scope.searchSupport);
				})
	}
});